﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AmiEmuLib.AmigaMachine.AmigaMemory;
using System.Diagnostics;

namespace AmiEmuLib.AmigaMachine.AmigaCPU
{
    internal class CPU68000 : CPU680x0
    {
        /// <summary>
        /// Prefetch.
        /// </summary>
        [DebuggerDisplay("{Hex.UIntToHex(IR)}")]
        public uint IR;

        /// <summary>
        /// Prefetch.
        /// </summary>
        [DebuggerDisplay("{Hex.UIntToHex(IRC)}")]
        public uint IRC;

        /// <summary>
        /// Supervisor stack pointer.
        /// </summary>
        [DebuggerDisplay("{Hex.UIntToHex(SSP)}")]
        public uint SSP;

        /// <summary>
        /// User stack pointer.
        /// </summary>
        [DebuggerDisplay("{Hex.UIntToHex(SSP)}")]
        public uint USP;

        /// <summary>
        /// Status register.
        /// </summary>
        [DebuggerDisplay("{AmiEmuLib.AmigaMachine.AmigaCPU.SR68000.Info(SR)}, {AmiEmuLib.AmigaMachine.AmigaCPU.CCRRegistry.Info(SR)}")]
        public ushort SR;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="a_machine"></param>
        internal CPU68000(Machine a_machine) 
            : base(a_machine)
        {
        }

        protected override void Reset()
        {
            IR = 0;
            IRC = 0;

            SSP = 0;
            USP = 0;

            SR = 0;
            SR68000.SetSupervisor(ref SR, true);

            base.Reset();
        }
    }
}
